package com.gopay.common.domain.fund;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * @author baiyunpeng
 * @2016年7月14日 下午3:36:05  www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "FUND_GOPAY_CARD")
public class FundGopayCardEntity extends BaseEntity {
    private String keyId;
    private String merchantId;
    private String gopayOrderId;
    private String merOrderNum;
    private String agentSignNo;
    private String bankCode;
    private String type;
    private String respCode;
    private String bankNo;
    private String mobile;
    private String realName;
    private String certificateType;
    private String certificateNo;
    private Date tranDateTime;
    private Date tranFinishTime;
    private String backgroundMerUrl;
    private String merRemark1;
    private String merRemark2;
    private String tranIp;
    private String memo;
    private String source;
    private Date createdTs;
    private Date lastUpdTs;
    private Integer version;

    @Id
    @GenericGenerator(name="systemUUID",strategy="uuid")
    @GeneratedValue(generator="systemUUID")
    @Column(name = "KEY_ID", insertable = true, updatable = true, nullable = false)
    public String getKeyId() {
        return keyId;
    }

    public void setKeyId(String keyId) {
        this.keyId = keyId;
    }

    @Basic
    @Column(name = "MERCHANT_ID")
    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    @Basic
    @Column(name = "GOPAY_ORDER_ID")
    public String getGopayOrderId() {
        return gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }

    @Basic
    @Column(name = "MER_ORDER_NUM")
    public String getMerOrderNum() {
        return merOrderNum;
    }

    public void setMerOrderNum(String merOrderNum) {
        this.merOrderNum = merOrderNum;
    }

    @Basic
    @Column(name = "AGENT_SIGN_NO")
    public String getAgentSignNo() {
        return agentSignNo;
    }

    public void setAgentSignNo(String agentSignNo) {
        this.agentSignNo = agentSignNo;
    }

    @Basic
    @Column(name = "BANK_CODE")
    public String getBankCode() {
        return bankCode;
    }

    public void setBankCode(String bankCode) {
        this.bankCode = bankCode;
    }

    @Basic
    @Column(name = "TYPE")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "RESP_CODE")
    public String getRespCode() {
        return respCode;
    }

    public void setRespCode(String respCode) {
        this.respCode = respCode;
    }

    @Basic
    @Column(name = "BANK_NO",length = 150)
    public String getBankNo() {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  start*/
        this.bankNo = SensitiveInfoUtils.autoReencrypt(this.bankNo);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.bankNo);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  end*/
    }

    public void setBankNo(String bankNo) {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  start*/
        this.bankNo = SensitiveInfoUtils.smartEncryptWithCheck(bankNo);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  end*/
    }

    @Basic
    @Column(name = "MOBILE")
    public String getMobile() {
        //return mobile;
        /**
         * modified by zyt 2017-4-10 自动重新加密并解密返回
         */
        this.mobile = SensitiveInfoUtils.autoReencrypt(this.mobile);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.mobile);
    }

    public void setMobile(String mobile) {
        //this.mobile = mobile;
        /**
         * modified by zyt 2017-4-10 写操作的时候做加密
         */
        this.mobile = SensitiveInfoUtils.smartEncryptWithCheck(mobile);
    }

    @Basic
    @Column(name = "REALNAME",length = 150)
    public String getRealName() {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  start*/
        this.realName = SensitiveInfoUtils.autoReencrypt(this.realName);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.realName);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  end*/
    }

    public void setRealName(String realName) {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  start*/
        this.realName = SensitiveInfoUtils.smartEncryptWithCheck(realName);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  end*/
    }

    @Basic
    @Column(name = "CERTIFICATE_TYPE")
    public String getCertificateType() {
        return certificateType;
    }

    public void setCertificateType(String certificateType) {
        this.certificateType = certificateType;
    }

    @Basic
    @Column(name = "CERTIFICATE_NO",length = 150)
    public String getCertificateNo() {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  start*/
        this.certificateNo = SensitiveInfoUtils.autoReencrypt(this.certificateNo);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.certificateNo);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  end*/
    }

    public void setCertificateNo(String certificateNo) {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  start*/
        this.certificateNo = SensitiveInfoUtils.smartEncryptWithCheck(certificateNo);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  end*/
    }

    @Basic
    @Column(name = "TRAN_DATE_TIME")
    public Date getTranDateTime() {
        return tranDateTime;
    }

    public void setTranDateTime(Date tranDateTime) {
        this.tranDateTime = tranDateTime;
    }

    @Basic
    @Column(name = "TRAN_FINISH_TIME")
    public Date getTranFinishTime() {
        return tranFinishTime;
    }

    public void setTranFinishTime(Date tranFinishTime) {
        this.tranFinishTime = tranFinishTime;
    }

    @Basic
    @Column(name = "BACKGROUND_MERURL")
    public String getBackgroundMerUrl() {
        return backgroundMerUrl;
    }

    public void setBackgroundMerUrl(String backgroundMerUrl) {
        this.backgroundMerUrl = backgroundMerUrl;
    }

    @Basic
    @Column(name = "MER_REMARK1")
    public String getMerRemark1() {
        return merRemark1;
    }

    public void setMerRemark1(String merRemark1) {
        this.merRemark1 = merRemark1;
    }

    @Basic
    @Column(name = "MER_REMARK2")
    public String getMerRemark2() {
        return merRemark2;
    }

    public void setMerRemark2(String merRemark2) {
        this.merRemark2 = merRemark2;
    }

    @Basic
    @Column(name = "TRAN_IP")
    public String getTranIp() {
        return tranIp;
    }

    public void setTranIp(String tranIp) {
        this.tranIp = tranIp;
    }

    @Basic
    @Column(name = "MEMO")
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "SOURCE")
    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    @Basic
    @Column(name = "CREATED_TS")
    public Date getCreatedTs() {
        return createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Basic
    @Column(name = "LAST_UPD_TS")
    public Date getLastUpdTs() {
        return lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }

    @Version
    @Column(name = "VERSION")
    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }


}
